﻿using System;
using System.IO;
using Coolite.Ext.Web;
using Microsoft.Practices.ServiceLocation;
using Pap.Web.Utils.CronJobs;

namespace Pap.Web
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Default : System.Web.UI.Page
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //ResponsibleWaitingListCtrl.LoansSubmitted += new EventHandler<AjaxEventArgs>(ResponsibleWaitingListCtrl_LoansSubmitted);
            responsibleSocialFeasibilityWaitingListControl.LoansSubmitted += new EventHandler<AjaxEventArgs>(ResponsibleSocialFeasibilityWaitingList1_LoansSubmitted);
            ExpertWaitingListCtrl.LoansSubmitted += new EventHandler<AjaxEventArgs>(ExpertWaitingListCtrl_LoansSubmitted);
        }

        /// <summary>
        /// Handles the LoansSubmitted event of the ResponsibleWaitingListCtrl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Coolite.Ext.Web.AjaxEventArgs"/> instance containing the event data.</param>
        void ResponsibleWaitingListCtrl_LoansSubmitted(object sender, AjaxEventArgs e)
        {
            responsibleSocialFeasibilityWaitingListControl.RefreshControl();
            ExpertWaitingListCtrl.RefreshControl();
        }

        /// <summary>
        /// Handles the LoansSubmitted event of the ResponsibleSocialFeasibilityWaitingList1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Coolite.Ext.Web.AjaxEventArgs"/> instance containing the event data.</param>
        void ResponsibleSocialFeasibilityWaitingList1_LoansSubmitted(object sender, AjaxEventArgs e)
        {
            ExpertWaitingListCtrl.RefreshControl();
        }

        /// <summary>
        /// Handles the LoansSubmitted event of the ExpertWaitingListCtrl control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Coolite.Ext.Web.AjaxEventArgs"/> instance containing the event data.</param>
        void ExpertWaitingListCtrl_LoansSubmitted(object sender, AjaxEventArgs e)
        {
            responsibleSocialFeasibilityWaitingListControl.RefreshControl();
        }
    }
}

